

package com.audi.activiey.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;


@Entity
@Table(name = "tbl_activity_comment")
public class ActivityComment implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	
    /**
     * commentId       db_column: comment_id 
     */ 	
	
	private Long commentId;
    /**
     * activityId       db_column: activity_id 
     * 所属活动
     */ 	
	
	private Long activityId;
    /**
     * userId       db_column: user_id 
     */ 	
	
	private Long userId;
    /**
     * nickName       db_column: nick_name 
     */ 	
	//@Length(max=64)
	private java.lang.String nickName;
    /**
     * content       db_column: content 
     */ 	
	//@Length(max=4000)
	private java.lang.String content;
    /**
     * 状态
     * 0 删除 1 正常 2 未审核 3审核未通过       db_column: status 
     */ 
	private Long status;
    /**
     * postIp       db_column: POST_IP 
     */ 	
	//@Length(max=16)
	private java.lang.String postIp;
    /**
     * createTime       db_column: CREATE_TIME 
     */ 	
	
	private java.util.Date createTime;
	//columns END


	public ActivityComment(){
	}

	public ActivityComment(
		Long commentId
	){
		this.commentId = commentId;
	}

	

	public void setCommentId(Long value) {
		this.commentId = value;
	}
	
	@Id 
	//@SequenceGenerator(name="activity_comment_SEQ",sequenceName="seq_activity_comment")
    //@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="activity_comment_SEQ") 
	@GenericGenerator(name="custom-id", strategy = "identity")
    @GeneratedValue(generator="custom-id")
	@Column(name = "comment_id")
	public Long getCommentId() {
		return this.commentId;
	}
	
	@Column(name = "activity_id")
	public Long getActivityId() {
		return this.activityId;
	}
	
	public void setActivityId(Long value) {
		this.activityId = value;
	}
	
	@Column(name = "user_id")
	public Long getUserId() {
		return this.userId;
	}
	
	public void setUserId(Long value) {
		this.userId = value;
	}
	
	@Column(name = "nick_name",length=64)
	public java.lang.String getNickName() {
		return this.nickName;
	}
	
	public void setNickName(java.lang.String value) {
		this.nickName = value;
	}
	
	@Column(name = "content",length=4000)
	public java.lang.String getContent() {
		return this.content;
	}
	
	public void setContent(java.lang.String value) {
		this.content = value;
	}
	
	@Column(name = "status")
	public Long getStatus() {
		return this.status;
	}
	
	public void setStatus(Long value) {
		this.status = value;
	}
	
	@Column(name = "POST_IP", updatable = true, length = 128)
	public java.lang.String getPostIp() {
		return this.postIp;
	}
	
	public void setPostIp(java.lang.String value) {
		this.postIp = value;
	}
	
	
	@Column(name = "CREATE_TIME")
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("CommentId",getCommentId())
			.append("ActivityId",getActivityId())
			.append("UserId",getUserId())
			.append("NickName",getNickName())
			.append("Content",getContent())
			.append("Status",getStatus())
			.append("PostIp",getPostIp())
			.append("CreateTime",getCreateTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getCommentId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof ActivityComment == false) return false;
		if(this == obj) return true;
		ActivityComment other = (ActivityComment)obj;
		return new EqualsBuilder()
			.append(getCommentId(),other.getCommentId())
			.isEquals();
	}
}

